/*
 * @Author: YNT 2501512800@qq.com
 * @Date: 2022-05-11 22:45:22
 * @LastEditors: YNT 2501512800@qq.com
 * @LastEditTime: 2022-08-01 11:49:54
 * @FilePath: \22-03-19 智慧社区\api\feature.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import wxRequest from '../utils/wx-request'

class SpecialModel extends wxRequest {
  // 招工轮播图
  bannerList() {
    return this.request({
      url: `/api/v1/banners/list?type_id=2`,
      method: 'GET',
    })
  }

  // 招工列表
  recruitmentList() {
    return this.request({
      url: `/api/v1/job_listing/list`,
      method: 'GET',
    })
  }

  // 招工详情
  recruitmentDetail(id) {
    return this.request({
      url: `/api/v1/job_listing?id=${id}`,
      method: 'GET',
    })
  }

  // 施工上报列表
  tipOffList() {
    return this.request({
      url: `/api/v1/construction/list`,
      method: 'GET',
    })
  }

  // 创建施工上报
  createTipOff(params) {
    return this.request({
      url: `/api/v1/construction`,
      method: 'POST',
      params,
    })
  }

  // 施工上报详情
  tipOffDetail(id) {
    return this.request({
      url: `/api/v1/construction?id=${id}`,
      method: 'GET',
    })
  }

  // 新增爆料
  addReport(params) {
    return this.request({
      url: `/api/v1/disclosure`,
      method: 'POST',
      params,
    })
  }

  // 爆料列表
  reportList() {
    return this.request({
      url: `/api/v1/disclosure/list`,
      method: 'GET',
    })
  }

  // 爆料详情
  reportDetail(id) {
    return this.request({
      url: `/api/v1/disclosure?id=${id}`,
      method: 'GET',
    })
  }

  // 资产公开列表
  propertyList() {
    return this.request({
      url: `/api/disclosure/asset/`,
      method: 'GET',
    })
  }

  // 资产详情
  propertyDetail(id) {
    return this.request({
      url: `/api/disclosure/asset/${id}/`,
      method: 'GET',
    })
  }

  // 资金公开列表
  propertyMoneyList() {
    return this.request({
      url: `/api/disclosure/capital/`,
      method: 'GET',
    })
  }

  // 资金详情
  propertyMoneyDetail(id) {
    return this.request({
      url: `/api/disclosure/capital/${id}/`,
      method: 'GET',
    })
  }
}

export default new SpecialModel()
